package mytomcat.servlet;

import mytomcat.anno.Servlet;
import mytomcat.core.MyRequest;
import mytomcat.core.MyResponse;
import mytomcat.dto.ServletInfo;
import mytomcat.servlet.base.MyServlet;

import java.io.IOException;

/**
 * <ul>
 * <li>Title:  HelloWorldServlet</li>
 * <li>Description: TODO </li>
 * <li>Copyright: Copyright (c) 2018</li>
 *
 * </ul>
 *
 * @author swc
 * @version     V1.0
 * @date 2020/4/20 0020 上午 9:53
 */
@Servlet(url ="hello")
public class HelloWorldServlet extends MyServlet {

    @Override
    public void doGet(MyRequest myRequest, MyResponse myResponse, ServletInfo servletInfo) {
        try {
            myResponse.write("欢迎来到 helloworld ....",null);
        }catch (IOException ex){
            ex.printStackTrace();
        }
    }

    public void doPost(MyRequest myRequest, MyResponse myResponse, ServletInfo servletInfo) {
        try {
            myResponse.write("欢迎来到 helloworld ....",null);
        }catch (IOException ex){
            ex.printStackTrace();
        }
    }
}
